#!usr/bin/env python
#-*- coding:utf-8 _*-
"""
@author:煜
@file: DownLoad.py
@time: 2018/10/20
"""
import requests
class DownLoad(object):
    def download(self,url):
        '''
        :param url:待爬取的网页URL
        :return:下载好的界面
        '''
        if url is None:
            return
        user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
        header={'User-Agent':user_agent}
        session=requests.Session()
        r=session.get(url,headers=header)
        if r.status_code==200:
            r.encoding='utf-8'
            return r.text
        return None
